package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.MajorListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StudentMajorInfoMapper;
import com.ruoyi.system.domain.StudentMajorInfo;
import com.ruoyi.system.service.IStudentMajorInfoService;

/**
 * 报名专业Service业务层处理
 *
 * @author luojiqiang
 * @date 2025-05-11
 */
@Service
public class StudentMajorInfoServiceImpl implements IStudentMajorInfoService {
    @Autowired
    private StudentMajorInfoMapper studentMajorInfoMapper;

    /**
     * 查询报名专业
     *
     * @param id 报名专业主键
     *
     * @return 报名专业
     */
    @Override
    public StudentMajorInfo selectStudentMajorInfoById(Long id) {
        return studentMajorInfoMapper.selectStudentMajorInfoById(id);
    }

    /**
     * 查询报名专业列表
     *
     * @param studentMajorInfo 报名专业
     *
     * @return 报名专业
     */
    @Override
    public List<StudentMajorInfo> selectStudentMajorInfoList(StudentMajorInfo studentMajorInfo) {
        return studentMajorInfoMapper.selectStudentMajorInfoList(studentMajorInfo);
    }

    /**
     * 新增报名专业
     *
     * @param studentMajorInfo 报名专业
     *
     * @return 结果
     */
    @Override
    public int insertStudentMajorInfo(StudentMajorInfo studentMajorInfo) {
        studentMajorInfo.setCreateTime(DateUtils.getNowDate());
        return studentMajorInfoMapper.insertStudentMajorInfo(studentMajorInfo);
    }

    /**
     * 修改报名专业
     *
     * @param studentMajorInfo 报名专业
     *
     * @return 结果
     */
    @Override
    public int updateStudentMajorInfo(StudentMajorInfo studentMajorInfo) {
        studentMajorInfo.setUpdateTime(DateUtils.getNowDate());
        return studentMajorInfoMapper.updateStudentMajorInfo(studentMajorInfo);
    }

    /**
     * 批量删除报名专业
     *
     * @param ids 需要删除的报名专业主键
     *
     * @return 结果
     */
    @Override
    public int deleteStudentMajorInfoByIds(Long[] ids) {
        return studentMajorInfoMapper.deleteStudentMajorInfoByIds(ids);
    }

    /**
     * 删除报名专业信息
     *
     * @param id 报名专业主键
     *
     * @return 结果
     */
    @Override
    public int deleteStudentMajorInfoById(Long id) {
        return studentMajorInfoMapper.deleteStudentMajorInfoById(id);
    }

    @Override
    public List<MajorListVO> getMajorList() {
        return studentMajorInfoMapper.getMajorList();
    }
}
